package com.google.code.chaotic.storedprocs;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ProcUtils {

	public static SQLException wrapAndLog(Throwable e) {
		Logger.getAnonymousLogger().log(Level.SEVERE, e.toString(), e);
		if (e instanceof SQLException)
			return (SQLException) e;
		return new SQLException(e.toString());
	}

	public static void appendToArrayStr(StringBuilder matesCsv, String mateId) {
		matesCsv.append("'");
		matesCsv.append(mateId.replace("'", "''"));
		matesCsv.append("'");
	}

}